<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:rich="http://richfaces.org/rich"
                template="layout/template.xhtml">

    <ui:define name="body">

        <h:messages globalOnly="true" styleClass="message"/>

        <h:form id="learningOutcomeForm">

            <rich:panel>
                <f:facet name="header">#{messages['learningoutcome']}</f:facet>

                <s:decorate id="numberDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['number']}</ui:define>
                    #{learningOutcomeHome.instance.number}
                </s:decorate>
                <s:decorate id="descriptionDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['learningoutcome.description']}</ui:define>
                    #{learningOutcomeHome.instance.description}
                </s:decorate>
                <s:decorate id="assessementDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['learningoutcome.assessement']}</ui:define>
                    #{learningOutcomeHome.instance.assessementTool}
                </s:decorate>
                <s:decorate id="timeScheduleDecoration" template="layout/display.xhtml">
                    <ui:define name="label">#{messages['learningoutcome.schedule']}</ui:define>
                    #{learningOutcomeHome.instance.timeSchedule}
                </s:decorate>

                <div style="clear:both"/>

            </rich:panel>

            <div class="actionButtons">
                <s:button view="/learningOutcomeEdit.xhtml"
                          id="edit"
                          value="#{messages['button.edit']}"/>
                <s:button view="/#{empty learningOutcomeFrom ? 'learningOutcomeList' : learningOutcomeFrom}.xhtml"
                          id="done"
                          value="#{messages['button.done']}"/>
                <s:button view="/traitEdit.xhtml"
                          id="addTrait"
                          value="#{messages['learningoutcome.addtrait']}">
                    <f:param name="traitFrom" value="learningOutcome" />
                    <f:param name="learningOutcomeId"
                             value="#{learningOutcome.id}"/>
                </s:button>
            </div>

        </h:form>
        <rich:panel>
            <f:facet name="header">#{messages['traits']}</f:facet>
            <rich:dataTable value="#{learningOutcomeHome.traits}" var="trait"
                            rendered="#{not empty learningOutcomeHome.traits}"
                            rowClasses="rvgRowOne,rvgRowTwo"
                            id ="traitsTable">
                <h:column>
                    <f:facet name="header">#{messages['trait.number']}</f:facet>
                    #{trait.number}
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['trait.name']}</f:facet>
                    <s:link view="/trait.xhtml"
                            id="selectTrait"
                            value="#{trait.name}"
                            propagation="none">
                        <f:param name="traitId"
                                 value="#{trait.id}"/>
                        <f:param name="traitFrom" value="learningOutcome"/>
                    </s:link>
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['trait.failsexpectations']}</f:facet>
                    #{trait.failsExpectations}
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['trait.meetsexpectations']}</f:facet>
                    #{trait.meetsExpectations}
                </h:column>
                <h:column>
                    <f:facet name="header">#{messages['trait.exceedsexpectations']}</f:facet>
                    #{trait.exceedsExpectations}
                </h:column>
            </rich:dataTable>
        </rich:panel>
    </ui:define>

</ui:composition>

